package ltd.hyangyang.rpc.client;

import ltd.hyangyang.rpc.client.controller.MessageController;
import ltd.hyangyang.rpc.client.service.MessageService;
import ltd.hyangyang.rpc.core.anno.RpcScann;
import ltd.hyangyang.rpc.core.anno.ServiceReference;
import ltd.hyangyang.rpc.entity.ClientMessage;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

@RpcScann(basePackage = "ltd.hyangyang")
public class ClientMain {


    public static void main(String[] args) {
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ClientMain.class);
        ClientMessage clientMessage = ClientMessage.builder().clientMessageId(1).clientMessage("hello,world").build();

        MessageController messageController = applicationContext.getBean(MessageController.class);

        messageController.hello(clientMessage);
    }


}
